/**Created by the LayaAirIDE*/
module view.ani{
	import Image = laya.ui.Image;
	import Handler = laya.utils.Handler;
	export class GainAward extends ui.ani.GainAwardUI{
		constructor(){
			super();
		}

		playActive():void{
			this.award_active.play(0,false)
		}

		playAni(initX, initY, overX, overY,farther, imgSrc, single=true):void{
			let array : Array<Image> = new Array();
			for(let i=0; i<4; i++){
				array[i] = new Image();
				array[i].loadImage(imgSrc,0,0,50,50);
				farther.addChild(array[i]);
				Laya.Tween.to(array[i],{x: overX,y : overY},1000,null,new Handler(array[i],array[i].destroy),500+200*i);
			}
			if(single){
				array[0].pos(initX,initY);
				array[1].pos(initX,initY);
				array[2].pos(initX,initY);
				array[3].pos(initX,initY);
			}else{
				array[0].pos(initX+10,initY+10);
				array[1].pos(initX-10,initY-10);
				array[2].pos(initX-10,initY+10);
				array[3].pos(initX+10,initY-10);
			}
			
		}
	}

}